package com.FangFaYingYong.A01FangFaYingYong;

import java.util.ArrayList;
import java.util.Collections;

public class A03_Function {
    public static void main(String[] args) {
        /*
        * 集合中有一些名字
        *   "张无忌", "周芷若", "赵敏", "张强", "张三丰", "张翠山", "张良", "王二麻子", "谢广坤"
        *    只要以 张 开头 名字是三个字的
        * */

        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list, "张无忌", "周芷若", "赵敏", "张强", "张三丰", "张翠山", "张良", "王二麻子", "谢广坤");
        // list.stream().filter(s-> s.length() == 3 && s.startsWith("张")).forEach(System.out::println);

        list.stream().filter(StringOperation::hasSize3AndZhang).forEach(System.out::println);
    }

}
